<html>
<head><meta charset="utf-8"><title>error in core · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html">error in core</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="237416072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237416072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237416072">(May 04 2021 at 23:24)</a>:</h4>
<p>so update on the error in core / backtrace in core work</p>



<a name="237416094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237416094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237416094">(May 04 2021 at 23:24)</a>:</h4>
<p>I finally got back to working on the backtrace in core and now have a working proof of concept implementation</p>



<a name="237416125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237416125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237416125">(May 04 2021 at 23:25)</a>:</h4>
<p>right now I'm using weak_lang_items to hook the behavior that's defined in std</p>



<a name="237416165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237416165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237416165">(May 04 2021 at 23:25)</a>:</h4>
<p>and the net effect of this is that <code>no_std</code> binaries must define these lang items now, so some tests are broken, I figure thats okay since this is just a proof of concept</p>



<a name="237416236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237416236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237416236">(May 04 2021 at 23:26)</a>:</h4>
<p>I was hoping to find some way to provide default implementations of these functions in the case where std isn't linked in, but for now I'm not convinced that's the best place to invest my effort</p>



<a name="237416394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237416394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237416394">(May 04 2021 at 23:28)</a>:</h4>
<p>So I'm currently trying to decide what the best next steps are</p>



<a name="237416408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237416408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237416408">(May 04 2021 at 23:28)</a>:</h4>
<p>the big question is should we go ahead and finish stabilizing the changes to the error trait?</p>



<a name="237416438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237416438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237416438">(May 04 2021 at 23:29)</a>:</h4>
<p>my feeling is we shouldn't, I'm relatively confident that the backtrace in core and the inherent method with Box being in std are both non issues</p>



<a name="237416470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237416470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237416470">(May 04 2021 at 23:29)</a>:</h4>
<p>but I'm not 100% confident</p>



<a name="237416545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237416545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237416545">(May 04 2021 at 23:30)</a>:</h4>
<p>Instead I think I should go ahead with just moving the error trait into core, and do the full Backtrace in core implementation, including an RFC</p>



<a name="237416603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237416603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237416603">(May 04 2021 at 23:30)</a>:</h4>
<p>I don't get the impression that it will be a large amount of work</p>



<a name="237416630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237416630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237416630">(May 04 2021 at 23:30)</a>:</h4>
<p>the main issue will be answering the questions about weak lang items and backtrace</p>



<a name="237424592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237424592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237424592">(May 05 2021 at 00:56)</a>:</h4>
<p>I'm not at all super invested into this, but it's exciting nonetheless :)</p>



<a name="237475076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237475076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237475076">(May 05 2021 at 10:53)</a>:</h4>
<p>we'll have to be careful this doesn't affect no_std users, even in code size etc.  a lot of no_std users have no use for Backtrace, and care a lot about code size, memory usage, etc.</p>



<a name="237475195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/237475195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#237475195">(May 05 2021 at 10:54)</a>:</h4>
<p>excited to see progress here. will be really nice to have Error in core</p>



<a name="240123682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240123682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240123682">(May 24 2021 at 22:58)</a>:</h4>
<p>recent conversation has me wondering if it would be possible to move the error trait into <code>liballoc</code> sooner rather than later, then eventually move it the rest of the way to <code>core</code>.</p>



<a name="240123710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240123710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240123710">(May 24 2021 at 22:59)</a>:</h4>
<p>this would enable <code>anyhow</code> and <code>eyre</code> to provide their full API on <code>no_std</code> + alloc I think</p>



<a name="240123738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240123738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240123738">(May 24 2021 at 22:59)</a>:</h4>
<p>here's the convo for reference: <a href="https://github.com/informalsystems/tendermint-rs/issues/669">https://github.com/informalsystems/tendermint-rs/issues/669</a></p>



<a name="240124295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240124295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240124295">(May 24 2021 at 23:05)</a>:</h4>
<p>has the issue around backtraces proved to be resolvable with less work than the work needed to get it to libcore?</p>
<p>when i filed <a href="https://github.com/rust-lang/rust/issues/62502">https://github.com/rust-lang/rust/issues/62502</a> a bajillion years ago, that was the issue that closed it</p>



<a name="240126663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240126663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240126663">(May 24 2021 at 23:34)</a>:</h4>
<p>ooh</p>



<a name="240126669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240126669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240126669">(May 24 2021 at 23:34)</a>:</h4>
<p>i already finished the proof of concept for Backtrace in core</p>



<a name="240126691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240126691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240126691">(May 24 2021 at 23:35)</a>:</h4>
<p>its far from approved though, and it affects our no_std binary API (new language items that have to be defined)</p>



<a name="240140116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240140116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240140116">(May 25 2021 at 04:02)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> no_std binaries are still nightly only. Only no_std libraries are stable IIRC.</p>



<a name="240140249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240140249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240140249">(May 25 2021 at 04:05)</a>:</h4>
<p>Yea, but I expect we may not want to add a bunch of new language items. There are alternative approaches we could still take</p>



<a name="240140335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240140335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240140335">(May 25 2021 at 04:07)</a>:</h4>
<p>So I figure the next step is to write an RFC on the changes to backtrace to get it in core</p>



<a name="240151466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240151466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240151466">(May 25 2021 at 07:28)</a>:</h4>
<p><span class="user-mention silent" data-user-id="219696">XAMPPRocky</span> <a href="#narrow/stream/219381-t-libs/topic/error.20in.20core/near/240140116">said</a>:</p>
<blockquote>
<p>no_std binaries are still nightly only. Only no_std libraries are stable IIRC.</p>
</blockquote>
<p>breaking no_std binaries would make a lot of people very unhappy though</p>



<a name="240168063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240168063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> HeroicKatora <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240168063">(May 25 2021 at 10:31)</a>:</h4>
<p><span class="user-mention silent" data-user-id="219696">XAMPPRocky</span> <a href="#narrow/stream/219381-t-libs/topic/error.20in.20core/near/240140116">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> no_std binaries are still nightly only. Only no_std libraries are stable IIRC.</p>
</blockquote>
<p>A combination of <code>#![no_std]</code>, <code>#![no_main]</code>, <code>#[no_mangle] extern fn main</code> 'works TM' on x86-64-linux stable:<br>
<a href="https://github.com/HeroicKatora/ethox/blob/master/ethox-no-std/main.rs">https://github.com/HeroicKatora/ethox/blob/master/ethox-no-std/main.rs</a><br>
It might technically not be intended to</p>



<a name="240181366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240181366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240181366">(May 25 2021 at 12:48)</a>:</h4>
<p>This is definitely intended, the entire embedded ecosystem relies on this working</p>



<a name="240181810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240181810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240181810">(May 25 2021 at 12:51)</a>:</h4>
<p>(this was stabilized and announced in Rust 1.30.0: <a href="https://blog.rust-lang.org/2018/10/25/Rust-1.30.0.html#no_std-applications">https://blog.rust-lang.org/2018/10/25/Rust-1.30.0.html#no_std-applications</a>)</p>



<a name="240183815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240183815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240183815">(May 25 2021 at 13:05)</a>:</h4>
<p>What’s not stable yet (blocked on <a href="https://github.com/rust-lang/rust/issues/66741">https://github.com/rust-lang/rust/issues/66741</a>) is no_std + alloc applications</p>



<a name="240213608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240213608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240213608">(May 25 2021 at 16:24)</a>:</h4>
<p>Maybe what I’m thinking about is no_std on custom platforms, as what was thinking about specifically was needing to define <code>eh_personality</code> which is not stable.</p>



<a name="240219053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240219053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240219053">(May 25 2021 at 17:03)</a>:</h4>
<p>Yeah, if the issue is breaking things that currently define lang items, that's not an issue as lang items aren't stable.</p>



<a name="240219131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240219131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240219131">(May 25 2021 at 17:04)</a>:</h4>
<p>We definitely shouldn't break <code>no_std</code> applications that build on stable today.</p>



<a name="240229926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240229926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240229926">(May 25 2021 at 18:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="229913">HeroicKatora</span> <a href="#narrow/stream/219381-t-libs/topic/error.20in.20core/near/240168063">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="219696">XAMPPRocky</span> <a href="#narrow/stream/219381-t-libs/topic/error.20in.20core/near/240140116">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="220273">Jane Lusby</span> no_std binaries are still nightly only. Only no_std libraries are stable IIRC.</p>
</blockquote>
<p>A combination of <code>#![no_std]</code>, <code>#![no_main]</code>, <code>#[no_mangle] extern fn main</code> 'works TM' on x86-64-linux stable:<br>
<a href="https://github.com/HeroicKatora/ethox/blob/master/ethox-no-std/main.rs">https://github.com/HeroicKatora/ethox/blob/master/ethox-no-std/main.rs</a><br>
It might technically not be intended to</p>
</blockquote>
<p>does this also need panic=abort to work?</p>



<a name="240229954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240229954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240229954">(May 25 2021 at 18:24)</a>:</h4>
<p>trying to figure out why you don't have to define <code>rust_eh_personality</code> like <span class="user-mention" data-user-id="219696">@XAMPPRocky</span> mentioned</p>



<a name="240230045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240230045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240230045">(May 25 2021 at 18:25)</a>:</h4>
<p>it's looking like the backtrace in core impl, if we were to straight up copy my proof of concept, would break these on stable</p>



<a name="240230164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240230164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240230164">(May 25 2021 at 18:26)</a>:</h4>
<p>I'm hoping there's a way to setup a fall back, so that if these item's aren't set the compiler provides default impls that just no-op whenever the backtrace APIs are called</p>



<a name="240230204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240230204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240230204">(May 25 2021 at 18:27)</a>:</h4>
<p>but I could not figure out how to do that before</p>



<a name="240230234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240230234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240230234">(May 25 2021 at 18:27)</a>:</h4>
<p>alternatively there are other approaches we discussed back in the backtrace stabilization PR / tracking issue iirc</p>



<a name="240230277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240230277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240230277">(May 25 2021 at 18:27)</a>:</h4>
<p>we could just remove <code>Backtrace</code> from <code>Error</code> and focus on generic member access since it provides a superset of the same functionality</p>



<a name="240230356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240230356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240230356">(May 25 2021 at 18:28)</a>:</h4>
<p>and maybe add an extension trait or something that's in the prelude that makes all the old <code>backtrace</code> calls on nightly work via generic member access...</p>



<a name="240230364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240230364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240230364">(May 25 2021 at 18:28)</a>:</h4>
<p>or we could just break them, they are unstable for a reason</p>



<a name="240230424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240230424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240230424">(May 25 2021 at 18:28)</a>:</h4>
<p>alternatively there was the proposal to introduce a <code>Backtrace</code> trait which goes into the Error trait interface instead and is defined in core</p>



<a name="240230452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240230452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240230452">(May 25 2021 at 18:29)</a>:</h4>
<p>the main concern that shot that down last time iirc was API stability on the <code>Backtrace</code> trait</p>



<a name="240230687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240230687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240230687">(May 25 2021 at 18:30)</a>:</h4>
<p>Either way, I think making a decision on Backtrace and moving forward is probably one of the top priority items that we need to resolve next to move forward with getting Error into core</p>



<a name="240244041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240244041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240244041">(May 25 2021 at 20:14)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> Have you considered or tried making them defined in <code>core</code>? That way it shouldn’t affect <code>#[no_std]</code> and <code>#[no_core]</code> is unstable.</p>



<a name="240244270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240244270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240244270">(May 25 2021 at 20:16)</a>:</h4>
<p>yea, a bit. initially I tried using weak linkage which would let me have a fallback impl of each function implemented locally, then I could check if the symbol was defined, and if I get a null ptr for it I could fall back. The issue though was that weak linkage isn't portable afaik</p>



<a name="240244281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240244281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240244281">(May 25 2021 at 20:16)</a>:</h4>
<p>also I don't think I got it to even work</p>



<a name="240244305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240244305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240244305">(May 25 2021 at 20:17)</a>:</h4>
<p>tho that's probably my fault</p>



<a name="240244347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240244347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240244347">(May 25 2021 at 20:17)</a>:</h4>
<p>as is though I don't see how core could define these, if core already provided the lang item then std wouldn't be able to</p>



<a name="240244406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/error%20in%20core/near/240244406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/error.20in.20core.html#240244406">(May 25 2021 at 20:18)</a>:</h4>
<p>and we can't actually move the full impl to core because that's the whole point of this change, its all <code>std</code> specific code that can't live in core</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>